package org.jeecg.zhenxuan.Repository;

import org.jeecg.zhenxuan.Entity.PointFlow;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;


@Repository
public interface PointAddRepository extends JpaRepository<PointFlow,Integer>, JpaSpecificationExecutor<PointFlow>  {

    PointFlow getPointFlowByOpenId(String openId);

    PointFlow getPointFlowById(Integer id);

    void removeById(Integer id);

    @Query("select max(id) from PointFlow where openId =?1 and operation ='add'")
    Integer getMax(String openId);

}
